# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-pcapy
_pkgname=pcapy
pkgver=0.11.5
pkgrel=3
pkgdesc='A Python extension module that interfaces with the libpcap packet capture library.'
url='https://pypi.org/project/pcapy/#files'
arch=('x86_64' 'aarch64')
license=('MIT')
depends=('python2' 'libpcap')
makedepends=('python2-setuptools')
source=("https://github.com/helpsystems/$_pkgname/archive/$pkgver.tar.gz")
sha512sums=('b7b5e81ed94e828501de01758292e18888497e77acc9864421b555b59de26f233c4365093e48213b36e27a51ad887e7f4d5ce2e4fac3f2f1a3006b5b75297977')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/share/doc/$_pkgname" "$pkgdir/usr/share/doc/$pkgname"
}

